UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OnDZrm6ZPW/Pgt9svwb1eHpwxYnGfNjFD3OZ9vFJiCo=' 
WHERE 
  key_id = 'ea3e33338ef63d01f61b3215598899752139ab407976f21e3433d848a1f50575' 
  AND (
    token = 'OnDZrm6ZPW/Pgt9svwb1eHpwxYnGfNjFD3OZ9vFJiCo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045