UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AwYLmr1CErc/6kN2p1HQ/rXnrR14E8vjDH0AUHcWsTc=' 
WHERE 
  key_id = 'cf99a3d1f0b027cae4f394bd999a96e359db3dc16b8fd810d9dd8fbfb37691e6' 
  AND (
    token = 'AwYLmr1CErc/6kN2p1HQ/rXnrR14E8vjDH0AUHcWsTc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00084