UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '33fAFbdPN9CoHXLuDn+l3/MHJwD+YNW9g6grY7I+hpY='
WHERE
key_id = '74b69bcb0e768ebe19e004db0df7ad872c50a048ab4cc2b094d641479fd04dd1'
AND (
token = '33fAFbdPN9CoHXLuDn+l3/MHJwD+YNW9g6grY7I+hpY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)