UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gq0lp+/T5Do0g7VMMbIFkQ3RucEKNzAjSHQmtg6Ziu0='
WHERE
key_id = '609732d71489b024a219ebcf00ffaca9a895a14dd0ea91aa0f78b621fd7c1a13'
AND (
token = 'gq0lp+/T5Do0g7VMMbIFkQ3RucEKNzAjSHQmtg6Ziu0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)