UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VlwC9w8rLsuyv8XOYRyHbIi3LnM8nUQVPQxzbYn9mqE='
WHERE
key_id = 'd8a07a877ca32e0658c00c3d3cf9982106cc859ca0aa27b4b24d592420f41914'
AND (
token = 'VlwC9w8rLsuyv8XOYRyHbIi3LnM8nUQVPQxzbYn9mqE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)