UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MeJ2FJqhMysJdeaAZGcXF/0PpXgtDawjShIDFxoTOs4=' 
WHERE 
  key_id = 'efdd8d4aa66bd97a158f49da2e3dc852206248ef1a6117d67b072d80af3cd6c6' 
  AND (
    token = 'MeJ2FJqhMysJdeaAZGcXF/0PpXgtDawjShIDFxoTOs4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026