UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Vo93VJRWAt0NUK0EnVly9FxG0xX3O9Lpu754M784AlU='
WHERE
key_id = '8cdf2008b2dcbbe1157d9a50f6c19ad69f3fc14a73f408918ea900e2b0c2208b'
AND (
token = 'Vo93VJRWAt0NUK0EnVly9FxG0xX3O9Lpu754M784AlU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)