UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XRSWNFulNRRJF/5wSKDfQD8Gyp/ddm1QoNLk4Km/6kc=' 
WHERE 
  key_id = 'f8bb0221f5f8ac3b6f9da0be66048a33e162f8e6cc2eb0801864c06f35fd332c' 
  AND (
    token = 'XRSWNFulNRRJF/5wSKDfQD8Gyp/ddm1QoNLk4Km/6kc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026