UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'C9dxsZ5rRFidBqS7NXyWujyLuOIRyUnWurUbdf4CHA0=' 
WHERE 
  key_id = '224eea34dec8867ec1428e62a292c78500ced2ab22b8ac32c43206412ddecaa4' 
  AND (
    token = 'C9dxsZ5rRFidBqS7NXyWujyLuOIRyUnWurUbdf4CHA0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041