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