UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IA2EendDcfJuVKThLwVw3W5afkhlL8mVa8HUtCfGhYA='
WHERE
key_id = '95a91bfbde2ff2b17b5957c040d2fba4217f856c2eb2051a9424168823b202e8'
AND (
token = 'IA2EendDcfJuVKThLwVw3W5afkhlL8mVa8HUtCfGhYA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)