UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uyCuNsBCQI5UVdBGc96Q4ylGfA5rtgeIfzqrMgbl+ts=' 
WHERE 
  key_id = 'e6577f5c320df1ad96c18ebd9ffafd7423e1282ef39483d4f3eef3e6bb8f52bf' 
  AND (
    token = 'uyCuNsBCQI5UVdBGc96Q4ylGfA5rtgeIfzqrMgbl+ts=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027