UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 't8e2klMCqUijusxJ1NaqP7TFiBM27jq1owahgSeAFFo='
WHERE
key_id = '49fc7b5a9fdd8b361fe0a58189088c44b5b8c5fd1ed2e1f55cf0ea85c1aad44a'
AND (
token = 't8e2klMCqUijusxJ1NaqP7TFiBM27jq1owahgSeAFFo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)