UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GNF8TwvUiJkXjrSsbwpqhhMcXEP1uZr9N9p8w2fvq2M=' 
WHERE 
  key_id = '906e5f08375b0602e71a78e161dedc9781aa6babe4a99c01aa814325eaa1fa8a' 
  AND (
    token = 'GNF8TwvUiJkXjrSsbwpqhhMcXEP1uZr9N9p8w2fvq2M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035