UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0yRZKKKPOWhmxhjUgH6YV0IOkuwsu7DVknYoi7HRDOc='
WHERE
key_id = '5e095329633f55ccb970d8b8caa979f159cb970db0388c6250b213857e1b846c'
AND (
token = '0yRZKKKPOWhmxhjUgH6YV0IOkuwsu7DVknYoi7HRDOc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)