UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lJZhjiEjB3ZwnMxHQCbqM9p87jaDZgBSk8lmHlAIwms=' 
WHERE 
  key_id = 'd35de374dcb23fa660f0b4428acdc33ff67a4c137b9dc1aa316482c426db1b84' 
  AND (
    token = 'lJZhjiEjB3ZwnMxHQCbqM9p87jaDZgBSk8lmHlAIwms=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053