UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3NvnNahGueoXhB6jgPY3muc3Q29xBCwiloLtOJrmPEc='
WHERE
key_id = 'bb6272eb8a25baff23bafe96e4e40b63be79eb74a893302792ab944bb26230d4'
AND (
token = '3NvnNahGueoXhB6jgPY3muc3Q29xBCwiloLtOJrmPEc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)