UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gY/0AT3v9yB7WjTPnfXHJNHl6xuS2bHm2ddB4akmvog='
WHERE
key_id = 'c08bbec0695bcc7a7bc7f5dd98e0db93ab96c05a456cc5d4f98a79e8accb8868'
AND (
token = 'gY/0AT3v9yB7WjTPnfXHJNHl6xuS2bHm2ddB4akmvog='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)