UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'd/+QHZcWP/gQ+/I85jWzxl1Q4GqMLL54aPyZx9cVJ4M='
WHERE
key_id = 'eb4df9c2027415010bca4e09945633b218b29e63f4b44b7a45abd3435fb2870a'
AND (
token = 'd/+QHZcWP/gQ+/I85jWzxl1Q4GqMLL54aPyZx9cVJ4M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)