UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'liAOqHY2Ve9PrSA+k56ljLyflNBlhS4IalcF9sFQ9x0='
WHERE
key_id = '98cce375ab70002c7862aa7f4f6d673a329e6be50e741b2c385dcb5debacf2ed'
AND (
token = 'liAOqHY2Ve9PrSA+k56ljLyflNBlhS4IalcF9sFQ9x0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)