UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'blJCYX9G/b6sy0n11zwzVW67VyoXw2+1OhfCmcPa/ZE='
WHERE
key_id = '05b17138de51cd3e6f433744ae8b09b8d0e0337642a1836b89c87b524d43b17c'
AND (
token = 'blJCYX9G/b6sy0n11zwzVW67VyoXw2+1OhfCmcPa/ZE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)