UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'M36bZ1QyNyUF6hf7jokfLrDSxkoP1j0lfI4oKjszc9A='
WHERE
key_id = 'c6cae39aa307eadc8eb4e65042187bdf8d064edfeebb7a2c39d32fdab4756c33'
AND (
token = 'M36bZ1QyNyUF6hf7jokfLrDSxkoP1j0lfI4oKjszc9A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)