UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Geisrswkhnu+/IjfOcJNrjW+ZuqZ0wEIt/LGnenbY7s='
WHERE
key_id = '8e862435cf00803a761163e451620fe97150c7ff85ca7ad56ee3e4f787f5f252'
AND (
token = 'Geisrswkhnu+/IjfOcJNrjW+ZuqZ0wEIt/LGnenbY7s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)