UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QJ/EXUUqgfhOPPCnpgS827EifvwmV/cD43nBdY65gnk='
WHERE
key_id = '9ffec8beeafaa936eb95afa0b8b22fb055fa2181fe3f62fc866676b8b9e1457c'
AND (
token = 'QJ/EXUUqgfhOPPCnpgS827EifvwmV/cD43nBdY65gnk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)