UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'y65/nLdvf7Io5CuwfkYH1dLgXeNkpEAllMjWkzi8FXo='
WHERE
key_id = '7e56c3a9888370521d46f194cdd1b6718aac05ae7ffc9a6c18e79b78df6e48b4'
AND (
token = 'y65/nLdvf7Io5CuwfkYH1dLgXeNkpEAllMjWkzi8FXo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)