UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'y1F3zeCm/g/QJVZFw5BLWdwjjalVjH2HHfXL7Dfi11g=' 
WHERE 
  key_id = '856da6672fffc2c73f750ffa7a6e5834baeccc2c51ffcd68390ddb4a3d2560a6' 
  AND (
    token = 'y1F3zeCm/g/QJVZFw5BLWdwjjalVjH2HHfXL7Dfi11g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032