UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'c8XMn3TBMGCVFWZnyd/G/0J2/VZgwNBev8h1BRSLZxQ='
WHERE
key_id = '77f4be7f6e7bf57ef3df9db7943ad3c02c1e6609153bcfa7e1200b30ada78168'
AND (
token = 'c8XMn3TBMGCVFWZnyd/G/0J2/VZgwNBev8h1BRSLZxQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)