UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4JIPcM4aYSU96qZkuN8ohSbOTVk1sZpm6VZ4TZOhPHU='
WHERE
key_id = 'e91e1d4d6444b11b2311f47ba5e829216dd82469435f556c7cb061142f8b2f67'
AND (
token = '4JIPcM4aYSU96qZkuN8ohSbOTVk1sZpm6VZ4TZOhPHU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)