UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5iLqdfDB3oeeYqDahnaQhJh51pUnfAMiSrxpmp9ixU8=' 
WHERE 
  key_id = '408e952feb8c5c8df1267615057e2ecd716a7dc70a835d5be414426c37a02c98' 
  AND (
    token = '5iLqdfDB3oeeYqDahnaQhJh51pUnfAMiSrxpmp9ixU8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028