UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PnfF+8HXSrtdTL/OZTPc9Z9Uw5/jY9pGKZiazpbmqyY='
WHERE
key_id = '89c84d11910dae06203403d8c5b85db2ff0e59f6d2b320afbcaff91c101dfc5d'
AND (
token = 'PnfF+8HXSrtdTL/OZTPc9Z9Uw5/jY9pGKZiazpbmqyY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)