UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9ngqjpSsTZfYy5IXMApxHLLREvRnRg6RqEweXEFu0Dk=' 
WHERE 
  key_id = 'b4f67e145a503e594c8dfa70e8ef29ab4ffd705bc11a7a27b505b7876917a7fc' 
  AND (
    token = '9ngqjpSsTZfYy5IXMApxHLLREvRnRg6RqEweXEFu0Dk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029