UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'i+te/TgtuiIbkapQpWupZC2fjfRSKCYK7+8VTXUBLYo=' 
WHERE 
  key_id = 'ec0320fda278ce21d60ccb3efff7f61230128d3c23d8c58596f3acad7a2ad670' 
  AND (
    token = 'i+te/TgtuiIbkapQpWupZC2fjfRSKCYK7+8VTXUBLYo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039