UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ftoH+qzVbHzNYKIXYjMukGUcwnL9kGQayyF7+1Gkv9w='
WHERE
key_id = '6286feea54fe49d663533e92257dcdc953e3b35f25181d08b18a7ff439f9f819'
AND (
token = 'ftoH+qzVbHzNYKIXYjMukGUcwnL9kGQayyF7+1Gkv9w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)